package BusinessLogic;

import java.util.LinkedList;
import java.util.List;

public class UserContainer {

	private List<User> userList;
	public UserContainer(List<User> userList) {
		this.userList = userList;
	}
	public List<User> getUserList() {
		return userList;
	}
	public int numberOfUsersIn(String letter)
	{
		int num = 0;
		for (User user : userList)
		{
			if (user.getName().startsWith(letter.toUpperCase())||user.getName().startsWith(letter.toLowerCase()))
				num++;
		}
		return num;
	}
	public List<User> getAllUsersIn(String letter)
	{
		List<User> users = new LinkedList<User>();
		for (User user : userList)
		{
			if (user.getName().startsWith(letter.toUpperCase())||user.getName().startsWith(letter.toLowerCase()))
				users.add(user);
		}
		return users;
	}

}
